﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>屏蔽状态栏的错误提示</title>
    <script type="text/javascript">
        window.onerror=function(){      //错误事件重写
            throw new Error("出错了");
        }
        function setError(){
            throw new Error("出错了");
        }
        try{
            setError("mm")      //触发错误
        }
        catch(e){           //捕获错误
            alert(e.description);//显示错误内容
        }
    </script>
</head>
<body>

</body>
</html>